import { getOrdersList } from "../../server/orders";
import { orderStatus } from "../../utils/data";

// pages/orders_info/orders_info.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    ordersId:null,
    AllList:null,
    orderStatus
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // console.log(options);
    this.setData({
      ordersId:options.ordersId
    })
    const data = {
      include:"orderDetails.goods,address"
    }
    getOrdersList(options.ordersId,data).then(res => {
      // console.log(res);
      this.setData({
        AllList:res
      })
    })
  },
  btnClick(){
    this.selectComponent("#play-btn").toSubmitOrders()
  }
})